
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include <rtdbg.h>
#include <lvgl.h>


extern void LCD_Init(void);
extern void touch_init(void);

//extern int drv_lcd_hw_init(void);
extern int lvgl_thread_init(void);
extern int rt_lvgl_demo_init(void);

/* defined the LED0 pin: PF9 */
#define LED0_PIN    GET_PIN(F, 9)

int main(void)
{
    int count = 1;
    /* set LED0 pin mode to output */
    rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);

    //先启动lcd驱动
    //drv_lcd_hw_init();

    LCD_Init();
    touch_init();

    //再启动lvgl环境
    lvgl_thread_init();

    //最后启动用户的demo程序
    //rt_lvgl_demo_init();

    while (count++)
    {
        rt_pin_write(LED0_PIN, PIN_HIGH);
        rt_thread_mdelay(500);
        rt_pin_write(LED0_PIN, PIN_LOW);
        rt_thread_mdelay(500);

    }
    return RT_EOK;
}
